package com.artifact.mit.mypoint.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.artifact.mit.mypoint.R;
import com.artifact.mit.mypoint.service.model.OrderHistory;

public class OrderHistoryAdapter extends ArrayAdapter<OrderHistory>{
	
	public OrderHistoryAdapter(Context context){
		super(context,0);
	}
	
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(
					R.layout.order_history_row_item, null);
		}
		
		TextView date = (TextView) convertView.findViewById(R.id.textView9);
		TextView po_number = (TextView) convertView.findViewById(R.id.textView10);
		TextView status = (TextView) convertView.findViewById(R.id.textView11);
		ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView1);
		
		date.setText(getItem(position).date);
		po_number.setText(getItem(position).po_number);
		status.setText(getItem(position).status);
		imageView.setImageResource(getItem(position).img);
		return convertView;
	}
}
